<?php
/**
 * Created by PhpStorm.
 * User: My pc
 * Date: 2017/2/14/014
 * Time: 22:34
 */
require substr(dirname(__FILE__),0,-7).'/init.inc.php';
if (isset($_GET['type'])) {
    //查看了源代码，他的名称是：upload
    $_fileupload = new FileUpload('upload',$_POST['MAX_FILE_SIZE']);
    $_ckefn = $_GET['CKEditorFuncNum'];
    $_path = $_fileupload->getPath();
    echo "<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction($_ckefn,\"$_path\",'图片上传成功！');</script>";
    exit();
} else {
    Tool::alertBack('警告：由于非法操作导致上传失败！');
}